// import Task from './src/task/placeUserStatusTask';
import { palaceIdTypeMap } from './src/config/variables';
import XLSX  from 'xlsx';

const getData = () => {
    // const museumTask = new Task();
  // museumTask.execute();
  const workbook = XLSX.readFile('test.xlsx');

  // 获取第一个工作表
  const sheetName = workbook.SheetNames[0];
  const worksheet = workbook.Sheets[sheetName];

  // 将工作表转换为 JSON 对象数组
  const jsonData = XLSX.utils.sheet_to_json(worksheet, {raw: false});

  return jsonData.map((item: any) => {
    return {
      appointDate: item['预约日期'],
      touristList: [{
        name: item['游客姓名'],
        idType: palaceIdTypeMap[item['证件类型']],
        idNo: item['证件号码'],
        ticketType: item['预约票种']
      }]
    }
  });
}

const main = async () => {
  console.log(getData()[0]);
}


main();